import 'package:car_map/mode/navigation_model.dart';
import 'package:car_map/widget/widget_navigation_item.dart';
import 'package:flutter/material.dart';

///停车场
class ParkingLotPage extends StatefulWidget{
  @override
  _parkingLotState createState() =>_parkingLotState();

}

class _parkingLotState extends State<ParkingLotPage>{
  List<NavigationModel> list;

  @override
  void initState() {
    // TODO: implement initState
    super.initState();
    navigationList();
  }

  @override
  Widget build(BuildContext context) {
    // TODO: implement build
    return Scaffold(
      appBar: AppBar(
        title: Text('停车场'),
      ),
      body: Container(
        child: ListView.builder(itemBuilder: (context,index){
          return WidgetNavigationItem.widgetNavigationItem(list[index]);
        },itemCount: list.length,),
      ),
    );
  }

  //制造假数据
  List<NavigationModel> navigationList(){
    list=new List();
    list.add(new NavigationModel(title: '科技七路停车场',
        address: '陕西省西安市雁塔区丈八沟街道木塔寨北村西南方向.22公里',
        latitude:34.2061236499,longitude:108.8921070099,
        iconData: Icons.local_parking));
    list.add(new NavigationModel(title: '科技四路停车场',
        address: '陕西省西安市雁塔区鱼化寨街道小烟庄村500米2000 英尺',
        latitude:34.2201772583,longitude:108.8616371155,
        iconData: Icons.local_parking));
    list.add(new NavigationModel(title: '团结南路停车场',
        address: '陕西省西安市雁塔区丈八沟街道南窑头社区东北方向',
        latitude:34.2176222311,longitude:108.8823223114,
        iconData: Icons.local_parking));
  }

}